home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Game-Power
/
Amiga Game-Power.iso
/
anwendungen
/
gw print
/
structurebrowser_v1.3
/
sources
/
sbwindow.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-20
|
9KB
|
273 lines
/*
Handles the Intuition Window structure
Not implemented:
Window.Pointer
Window.UserPort
Window.WindowPort
Window.MessageKey
Window.ExtData
Window.UserData
*/
#include "header/sb.h"
extern int level; /* recursion level */
/* PrWindow
Put up the first page of data for a Window structure.
*/
PrWindow (string, window)
char *string;
struct Window *window;
{
static struct StructData structdata[] = {
{ " NextWindow", "struct Window *", PRPTR, PTRSIZE },
{ "-LeftEdge", "SHORT", PRINT, INTSIZE },
{ "-TopEdge", "SHORT", PRINT, INTSIZE },
{ "-Width", "SHORT", PRINT, INTSIZE },
{ "-Height", "SHORT", PRINT, INTSIZE },
{ "-MouseY", "SHORT", PRINT, INTSIZE },
{ "-MouseX", "SHORT", PRINT, INTSIZE },
{ "-MinWidth", "SHORT", PRINT, INTSIZE },
{ "-MinHeight", "SHORT", PRINT, INTSIZE },
{ "-MaxWidth", "SHORT", PRINT, INTSIZE },
{ "-MaxHeight", "SHORT", PRINT, INTSIZE },
{ " Flags", "ULONG", PRULONG, PTRSIZE },
{ " MenuStrip", "struct Menu *", PRPTR, PTRSIZE },
{ " Title", "UBYTE *", PRSTRING, PTRSIZE },
{ " FirstRequest", "struct Requester *", PRPTR, PTRSIZE },
{ " DMRequest", "struct Requester *", PRPTR, PTRSIZE }
};
static char *flagnames[32] = {
"WINDOWSIZING", "WINDOWDRAG", "WINDOWDEPTH", "WINDOWCLOSE",
"SIZEBRIGHT", "SIZEBBOTTOM", "SIMPLE_REFRESH", "OTHER_REFRESH",
"BACKDROP", "REPORTMOUSE", "GIMMEZEROZERO", "BORDERLESS",
"ACTIVATE", "WINDOWACTIVE", "INREQUEST", "MENUSTATE",
"RMBTRAP", "NOCAREREFRESH", NULL, NULL,
NULL, NULL, NULL, NULL,
"WINDOWREFRESH", "WBENCHWINDOW", "WINDOWTICKED"
};
int i, sum;
int choice = -1;
ULONG bits;
level++;
while (choice)
{
sum = SetOptionText(string, structdata, (APTR)window, DATASIZE, 0);
switch (choice = GetChoice(MAXGADG + 1))
{
case 1:
if (window->NextWindow)
PrWindow("The next window in Intuition's list",
window->NextWindow);
break;
case 12:
bits = window->Flags & ~SUPER_UNUSED;
switch ((bits & REFRESHBITS) >> 6)
{
case 0:
flagnames[6] = "SMART_REFRESH";
bits |= 0x40;
break;
case 1:
flagnames[6] = "SIMPLE_REFRESH";
break;
case 2:
flagnames[7] = "SUPER_BITMAP";
break;
case 3:
flagnames[7] = "OTHER_REFRESH";
bits ^= 0x40;
break;
}
FlagPrint("Flags set in this window", flagnames, bits);
break;
case 13:
if (window->MenuStrip)
PrMenu("This Window's first Menu", window->MenuStrip);
break;
case 14:
PrString("The Window's Title", window->Title);
break;
case 15:
if (window->FirstRequest)
PrRequester("This Window's first Requester",
window->FirstRequest);
break;
case 16:
if (window->DMRequest)
PrRequester("The double-click Requester for this Window",
window->DMRequest);
break;
case MOREGADG:
PrWindow2("Window members (page 2)", window, sum);
break;
}
}
level--;
}
/* PrWindow2
Put up the second page of data for a Window structure.
*/
PrWindow2 (string, window, offset)
char *string;
struct Window *window;
int offset;
{
static struct StructData structdata[] = {
{ "-ReqCount", "SHORT", PRINT, INTSIZE },
{ " WScreen", "struct Screen *", PRPTR, PTRSIZE },
{ " RPort", "struct RastPort *", PRPTR, PTRSIZE },
{ "-BorderLeft", "BYTE", PRBYTE, BYTESIZE },
{ "-BorderTop", "BYTE", PRBYTE, BYTESIZE },
{ "-BorderRight", "BYTE", PRBYTE, BYTESIZE },
{ "-BorderBottom", "BYTE", PRBYTE, BYTESIZE },
{ " BorderRPort", "struct RastPort *", PRPTR, PTRSIZE },
{ " FirstGadget", "struct Gadget *", PRPTR, PTRSIZE },
{ " Parent", "struct Window *", PRPTR, PTRSIZE },
{ " Descendant", "struct Window *", PRPTR, PTRSIZE },
{ "(Pointer", "USHORT *)", PRPTR, PTRSIZE },
{ "-PtrHeight", "BYTE", PRBYTE, BYTESIZE },
{ "-PtrWidth", "BYTE", PRBYTE, BYTESIZE },
{ "-XOffset", "BYTE", PRBYTE, BYTESIZE },
{ "-YOffset", "BYTE", PRBYTE, BYTESIZE }
};
int i, sum;
int choice = -1;
level++;
while (choice)
{
sum = SetOptionText(string, structdata,
(APTR)window, DATASIZE, offset);
switch (choice = GetChoice(MAXGADG + 1))
{
case 2:
if (window->WScreen)
PrScreen("The screen referenced in the window structure",
window->WScreen);
break;
case 3:
if (window->RPort)
PrRastPort("The window's RPort (RastPort)", window->RPort);
break;
case 8:
if (window->BorderRPort)
PrRastPort("The window's BorderRPort", window->BorderRPort);
break;
case 9:
if (window->FirstGadget)
PrGadget("The window's first gadget", window->FirstGadget);
break;
case 12:
printf("Sorry, selection not implemented\n\n");
break;
case 10:
if (window->Parent)
PrWindow("The `parent' window", window->Parent);
break;
case 11:
if (window->Descendant)
PrWindow("The `descendant' window", window->Descendant);
break;
case MOREGADG:
PrWindow3("Window members (page 3)", window, sum);
break;
}
}
level--;
}
/* PrWindow3
Put up the third page of data for a Window structure.
*/
PrWindow3 (string, window, offset)
char *string;
struct Window *window;
int offset;
{
static struct StructData structdata[] = {
{ " IDCMPFlags", "ULONG", PRLONG, PTRSIZE },
{ "(UserPort", "struct MsgPort *)", PRPTR, PTRSIZE },
{ "(WindowPort", "struct MsgPort *)", PRPTR, PTRSIZE },
{ "(MessageKey", "struct IntuiMessage *)", PRPTR, PTRSIZE },
{ "-DetailPen", "UBYTE", PRUBYTE, BYTESIZE },
{ "-BlockPen", "UBYTE", PRUBYTE, BYTESIZE },
{ " CheckMark", "struct Image *", PRPTR, PTRSIZE },
{ " ScreenTitle", "UBYTE *", PRSTRING, PTRSIZE },
{ "-GZZMouseX", "SHORT", PRINT, INTSIZE },
{ "-GZZMouseY", "SHORT", PRINT, INTSIZE },
{ "-GZZWidth", "SHORT", PRINT, INTSIZE },
{ "-GZZHeight", "SHORT", PRINT, INTSIZE },
{ "(ExtData", "UBYTE *)", PRPTR, PTRSIZE },
{ "(UserData", "BYTE *)", PRPTR, PTRSIZE },
{ " WLayer", "struct Layer *", PRPTR, PTRSIZE }
};
static char *IDCMPnames[32] = {
"SIZEVERIFY", "NEWSIZE", "REFRESHWINDOW", "MOUSEBUTTONS",
"MOUSEMOVE", "GADGETDOWN", "GADGETUP", "REQSET",
"MENUPICK", "CLOSEWINDOW", "RAWKEY", "REQVERIFY",
"REQCLEAR", "MENUVERIFY", "NEWPREFS", "DISKINSERTED",
"DISKREMOVED", "WBENCHMESSAGE", "ACTIVEWINDOW", "INACTIVEWINDOW",
"DELTAMOVE", "VANILLAKEY", "INTUITICKS", NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, "LONELYMESSAGE"
};
int i, sum;
int choice = -1;
level++;
while (choice)
{
sum = SetOptionText(string, structdata,
(APTR)window, DATASIZE, offset);
switch (choice = GetChoice(DATASIZE))
{
case 1:
FlagPrint("IDCMP flags set in this window",
IDCMPnames, window->IDCMPFlags);
break;
case 7:
if (window->CheckMark)
PrImage("The CheckMark Image for this Window",
window->CheckMark);
break;
case 8:
PrString("The screen title when this window is activated",
window->ScreenTitle);
break;
case 15:
if (window->WLayer)
PrLayer("The Layer for this Window", window->WLayer);
break;
}
}
level--;
}